Fix test failure in changing_bin_features_caches_targets for Linux.
authorEric Huss <eric@huss.org>
Tue, 22 May 2018 11:45:46 +0000 (04:45 -0700)
committerEric Huss <eric@huss.org>
Tue, 22 May 2018 11:45:46 +0000 (04:45 -0700)
commit83e87d42128d07bef733c26bd395d69e99c98655
treefb22e8934cdca2dad977e9fd4d34c25f5ad95ed7
parent64f8f1b72f6afaa2fcc01e30537e3efdb1d651f2
Fix test failure in changing_bin_features_caches_targets for Linux.

Fixes rust-lang/rust#50962.

My theory is that while copying the binary, another thread forked with the fd
open.  The copy finishes and attempts to exec before the other child execs (and
closes the writeable fd).

I was able to easily repro this on linux.  I ran some stress tests of this fix
locally on linux and on appveyor, and was unable to trigger it again.
tests/testsuite/freshness.rs